package cn.edu.zafu.bigdata.x.qianjingxuan;

public class Course {
    // 属性
    private String courseName;
    private String courseCode;
    private int credits;

    // 构造器
    public Course(String courseName, String courseCode, int credits) {
        this.courseName = courseName;
        this.courseCode = courseCode;
        this.credits = credits;
    }

    // Getter 和 Setter 方法
    public String getCourseName() {
        return courseName;
    }

    public void setCourseName(String courseName) {
        this.courseName = courseName;
    }

    public String getCourseCode() {
        return courseCode;
    }

    public void setCourseCode(String courseCode) {
        this.courseCode = courseCode;
    }

    public int getCredits() {
        return credits;
    }

    public void setCredits(int credits) {
        this.credits = credits;
    }

    // 显示课程信息的方法
    public void displayCourseInfo() {
        System.out.println("Course Name: " + courseName);
        System.out.println("Course Code: " + courseCode);
        System.out.println("Credits: " + credits);
    }

    // main 方法
    public static void main(String[] args) {
        Course javaCourse = new Course("Java Programming", "CS101", 4);


        javaCourse.displayCourseInfo();
    }
}

